package com.hupo.dy07_springboot_01.controller;

import com.hupo.dy07_springboot_01.Pojo.User;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@CrossOrigin
@RestController//表示当前类是一个请求处理类
public class helloController {
    ArrayList<User> list = new ArrayList<User>();

    @RequestMapping("/register")
    public ArrayList<User> register(User user) {
        list.add(user);
        return list;
    }

    @RequestMapping("/hello")
    public String hello(){
        System.out.println(1/0);
        return "hello";
    }
}
